package com.wellink.android_demo.com.wellink.android_demo.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Button;
import android.widget.Toast;

public class MyButton2 extends Button {
    public MyButton2(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        super.onTouchEvent(event);

        Toast.makeText(getContext(),"Hello,You Touch me...",Toast.LENGTH_LONG).show();

        return  false;// 返回false，表明该事件会向外扩散
    }
}
